package com.stone.ble;

import android.app.Application;

import com.stone.ble.database.DBController;
import com.stone.ble.database.DBControllerImpl;

public class StoneApplication extends Application {

	private static StoneApplication mInstance;
	private DBController mDBController;

	@Override
	public void onCreate() {
		super.onCreate();
		mInstance = this;
		getmDBController();
	}

	public static StoneApplication getInstance() {
		return mInstance;
	}

	public DBController getmDBController() {
		if (mDBController == null) {
			mDBController = new DBControllerImpl();
			mDBController.init(this, DBController.DB_NAME,
					DBController.DB_VERSION, R.raw.database);
		}
		mDBController.open();
		mDBController.close();
		return mDBController;
	}

}
